#include"Protocal.hpp"

static void* HandleRequest(void* argc)
{
  LOG(INFO,"HandleRequest Start");
  int sock=*(int*)argc;
  
  EndPoint ep(sock);
  
  if(ep.RecvHttpRequest())
  if(ep.ParseHttpRequest())
  if(ep.HandleHttpRequest())
  if(ep.BuildHttpResponse())
  ep.SendHttpResonse();


//  delete (int*)argc;

  LOG(INFO,"HandleRequest End");
  
  return nullptr;
}

class CallBack
{
  public:
   CallBack(){}

   void operator()(int sock)
   {
     HandleRequest(&sock);
   }
};
